package com.fc.redis.mapper;

import com.fc.redis.entity.TbOrder;
import com.fc.redis.entity.TbOrderExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.session.RowBounds;

public interface TbOrderMapper {

    @Select("select money from tb_order where id>= #{beforeId} limit #{size}")
    List<Integer> selectMoney(@Param("beforeId") Integer beforeId, @Param("size") Integer size);
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    long countByExample(TbOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    int deleteByExample(TbOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    @Delete({
        "delete from tb_order",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    @Insert({
        "insert into tb_order (money)",
        "values (#{money,jdbcType=INTEGER})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(TbOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    int insertSelective(TbOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    List<TbOrder> selectByExampleWithRowbounds(TbOrderExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    List<TbOrder> selectByExample(TbOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    @Select({
        "select",
        "id, money",
        "from tb_order",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.fc.redis.mapper.TbOrderMapper.BaseResultMap")
    TbOrder selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    int updateByExampleSelective(@Param("record") TbOrder record, @Param("example") TbOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    int updateByExample(@Param("record") TbOrder record, @Param("example") TbOrderExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    int updateByPrimaryKeySelective(TbOrder record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated Sat May 30 08:48:44 CST 2020
     */
    @Update({
        "update tb_order",
        "set money = #{money,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(TbOrder record);

    /**
     * 这是Mybatis Generator拓展插件生成的方法(请勿删除).
     * This method corresponds to the database table tb_order
     *
     * @mbg.generated
     * @author hewei
     */
    int batchInsert(@Param("list") List<TbOrder> list);
}